<include file="Public:header" />
<section role="main" class="content-body">
    <header class="page-header"></header>
    <!-- start: page -->
    <section class="panel">
        <header class="panel-heading">
            <h2 class="panel-title">配套升级</h2></header>
        <div class="panel-body">
            <form class="form-horizontal form-bordered" method="post" id="form" autocomplete="off">
                <div class="form-group"></div>
                <div class="form-group">
                    <label class="col-md-3 control-label" for="inputSuccess">目前级别</label>
                    <div class="col-md-6">
                        <input class="form-control input-lg mb-md has-value" id="inputReadOnly" readonly="" value="{$leavel_type[$home_user_info['leavel']]['name']}"></div>
                </div>
                <div class="form-group">
                    <label class="col-md-3 control-label" for="inputSuccess">配套升级至</label>
                    <div class="col-md-6">
                        <select class="form-control input-lg mb-md package" id="sl-package" name="leavel">
                            <option value="0">请选择。。。</option>
                            <volist name="leavel_type" id="vo">
                                <lt name="home_user_info['leavel']" value="$vo['id']">
                                    <option value="{$vo['id']}">{$vo['name']}</option></lt>
                            </volist>
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <div class="form-group">
                        <label class="col-lg-3 control-label" for="color"></label>
                        <div class="col-lg-2" style="margin-bottom:15px;">
                            <label id="d-point-err" style="display: none; color: tomato">余额不足</label>
                            <br>
                            <button class="btn btn-default" type="button">{$currency[6]['name']}:
                                <strong>{$user_money['6']['num']}个</strong></button>
                        </div>
					</div>
                </div>
                <div class="form-group">
                    <label class="col-md-3 control-label" for="textareaDefault">二级密码*</label>
                    <div class="col-md-6">
                        <input class="form-control" name="twopassword" maxlength="20" type="password" data-plugin-maxlength="" placeholder="请输入您的二级密码" id="twopassword" value=""></div>
                </div>
            </form>
        </div>
    </section>
    <footer class="panel-footer">
        <div class="row">
            <div class="col-sm-6 col-sm-offset-3">
                <button class="mb-xs mt-xs mr-xs btn btn-primary" name="submit" type="button" onclick="sub()">提交</button>
                <a href="dashboard.php" id="position-4-error" class="mb-xs mt-xs mr-xs btn btn-default" type="reset">取消</a></div>
        </div>
    </footer>
    <!-- start: sidebar-right -->
    <!-- start: sidebar-right -->
    <aside id="sidebar-right" class="sidebar-right">
        <div class="nano has-scrollbar">
            <div class="nano-content" tabindex="0" style="right: -17px;">
                <a href="#" class="mobile-close visible-xs">回到儀表板
                    <i class="fa fa-chevron-right"></i></a>
            </div>
            <div class="nano-pane" style="display: none; opacity: 1; visibility: visible;">
                <div class="nano-slider" style="height: 472px; transform: translate(0px, 0px);"></div>
            </div>
        </div>
    </aside>
    <!-- end: sidebar-right -->
    <!-- end: sidebar-right --></section>
		<script>
			function sub(){
				$.ajax({
					 type: "POST",
					 url: "{:U('Team/upgradeSub')}",
					 data: $("#form").serialize(),
					 dataType: "json",
					 error: function(request) {
						layer.closeAll('loading');
						layer.msg("{$Think.lang.系统繁忙请稍后再试}");
					},
					beforeSend: function() {
						var index = layer.load(1, {
						  shade: [0.1,'#fff'] 
						});
					},
					 success: function(data){
							layer.closeAll('loading');
							layer.msg(data['info']);
							if(data['status']==true){
								setTimeout(function(){self.location.href="{:U('User/index')}"},1000);
							}
						}
				});
			};
		</script>
<include file="Public:footer" />